<template>
    <Layout class="p-5 bg-white">
        <Form class="p-5" :model="deposit" :label-width="130">
			<Row>
				<Col span="8">
					<FormItem class="w-100" label="客户名">
						<label>: {{this.client.clientName}}</label>
					</FormItem>
					<FormItem class="w-100" label="押金记录编号">
						<label>: {{this.deposit.depositId}}</label>
					</FormItem>
					<FormItem class="w-100" label="支付平台支付编号">
						<label>: {{this.payment.originalCode}}</label>
					</FormItem>
					<FormItem class="w-100" label="门店">
						<label>: {{this.store.name}}</label>
					</FormItem>
					<FormItem class="w-100" label="创建时间">
						<label>: {{this.deposit.ct}}</label>
					</FormItem>
					<FormItem class="w-100" label="交易金额">
						<label>: {{this.deposit.amount}}</label>
					</FormItem>
					<FormItem class="w-100" label="押金类型">
						<label v-if="this.deposit.type=='INS'">: 押金充值</label>
						<label v-else>: 押金退还</label>
					</FormItem>
					<FormItem class="w-100" label="原因">
						<label>: {{this.deposit.reason}}</label>
					</FormItem>
				</Col>
			</Row>
            
            
			<FormItem>
			    <Button @click="cancel" style="margin-left: 8px">取消</Button>
			</FormItem>
        </Form>
    </Layout>

</template>
<script>
    export default {
        data() {
            return {
				deposit:{},
				payment:{},
				client:{},
				store:{},
				depositId:0,
            }
        },
        methods: {
            cancel: function () {
                this.$tabs.close();
            },
			
			search: function() {
				this.http.get({
					url: "/client/deposit-record/details",
					param: {
						depositId : this.$data.depositId
					}
				}).then(data => {
					data.deposit_record.ct = data.deposit_record.ct.replace('T',' ');
					this.$data.deposit = data.deposit_record;
					this.$data.payment = data.payment_record;
					this.$data.client = data.client;
					this.$data.store = data.store;
					this.$data.deposit.amount = data.deposit_record.amount/100;
				});
			},
			
			
            init: function () {
                this.search();
            },

        },

        created: function () {
        },
        mounted: function () {
			this.$data.depositId = this.$route.params.depositId;
            this.init();
        }
    }
</script>

<style>
</style>
